package com.alibaba.dubbo.common.serialize.support.kryo;

import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.Serializer;
import com.esotericsoftware.kryo.io.Input;
import com.esotericsoftware.kryo.io.Output;
import com.esotericsoftware.kryo.serializers.MapSerializer;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by SunLei on 2016/2/22.
 */
public class MapWrapperSerializer extends Serializer<Object>{
    private final MapSerializer mapSerializer=new MapSerializer();

    @Override
    public void write(Kryo kryo, Output output, Object object) {
        mapSerializer.write(kryo,output,(Map)object);
    }

    @Override
    public Object read(Kryo kryo, Input input, Class<Object> type) {
        if(type.getClass().equals(Map.class)){
//            mapSerializer.read(kryo,input,HashMap.class);
        }
        return null;
    }


}
